

//分页
export default {
	data: function() {
		return {
			page: {
				targetPage: 1, //当前页码
				pageSize: 10, //显示条数
				totalPage: 1, //总条数
			},
			req: null, // search时拷贝查询表单
			tableLoading: false,//控制接口禁用
		}
	},
	methods: {
		changePage(val, state) {
			if(state) { //修改显示条数
				this.page.pageSize = val;
				this.page.targetPage = 1;
			} else { //页码改变
				this.page.targetPage = val;
			}
			this.getData();
		},
		//查询数据
		search(type) {
			if (this.form) {
				this.req = JSON.parse(JSON.stringify(this.form));
			}
			this.page.targetPage = 1;
			if(type == 1){//如果类型为1时分页设置默认值
				this.page.pageSize = 10;
			}
			this.getData();
		}
	},
}